<%@page import="at.com.vn.chess.entity.Room"%>
<%@page import="org.apache.log4j.Logger"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%! 
	String rootPath = "";
	final Logger logger = Logger.getLogger( getClass() );
%>
<% 
	rootPath = application.getContextPath();
	logger.info( "Bat dau" );
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>vn shogi - chess Table</title>
<link href="<%=rootPath%>/pages/styles.css" type="text/css"
	media="screen" rel="stylesheet">
<script type="text/javascript">
	function doLogout(userID) {
		document.myform.action = "RoomServlet" + "?UserID=" + userID;
		document.myform.submit();
	}
	function doBackRoomList(backFromChess) {
		document.myform.action = "RoomServlet" + "?BackFromChess="
				+ backFromChess;
		document.myform.submit();
	}
</script>
</head>
<body id="management" onload="setAppletParams();">
	<div id="wrappertop"></div>
	<div id="wrapper">
		<div id="content">
			<div id="header">
				<h1>
					<a href=""><img src="<%=rootPath%>/images/logo.png"
						alt="ChessApplication"> </a>
				</h1>
			</div>
			<div id="darkbanner" class="banner320">
				<h2>Chess management</h2>
			</div>
			<div id="darkbannerwrap"></div>

			<%
				Room room = (Room) session.getAttribute("currentSessionRoom");
				String userID = (String) session
						.getAttribute("currentSessionUserID");

				session.removeAttribute("currentSessionRoom");
				session.removeAttribute("currentSessionUserID");
			%>

			<form name="myform" method="post">
				<p class="message">
					<%=room.getRoom_name()%>
					room welcome
					<%=userID%>
				</p>
				<%
					logger.info( "UrlBase: " + rootPath );
				%>
				<applet name="ChatApp" code="at.com.vn.chess.applet.ChatApplet"
					archive="ChessApplet.jar,XMLHelper.jar,l2fprod-swingx.jar"
					width=800 height=560>

					<param name="UserID" value="<%=userID%>">
					<param name="RoomID" value="<%=room.getRoom_id()%>">
					<param name="UrlBase" value="<%=rootPath%>" />

					<param name="java_arguments" value="-Dfile.encoding=utf-8">
				</applet>
			</form>
		</div>
	</div>

	<div id="wrapperbottom_branding">
		<div id="wrapperbottom_back_text">
			<a href="javascript:doBackRoomList('IsBackFromChess');">Back</a>
			&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a
				href="javascript:doLogout('<%=userID%>');">Log out</a>
		</div>
	</div>
	<jsp:include page="footer_copyright.jsp" />
</body>
</html>